home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!not-for-mail
- From: gusty@clark.net (Harlan Messinger)
- Newsgroups: comp.lang.c++
- Subject: Re: extern consts
- Date: 18 Mar 1996 04:02:57 GMT
- Organization: Clark Internet Services, Inc., Ellicott City, MD USA
- Message-ID: <4iin9h$fdk@clarknet.clark.net>
- References: <4idbcv$ue2@news7.erols.com> <314c2077.138956468@nntp.ix.netcom.com> <4ii7h9$bq6@news6.erols.com>
- NNTP-Posting-Host: explorer.clark.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
-
- Chris Cobb (ccobb@cseg.com) wrote:
- : miker3@ix.netcom.com (Mike Rubenstein) wrote:
- : >
- : >It's not legal. extern const is legal, but in any compilation unit
- : >that does not see the initializer the const variable is not a constant
- : >expression.
- : >
- :
- : Well, your comment makes sense. However, in a way it seem
- : self-contradictory. If a const can be extern, then it no longer is a
- : const: you've basically externed away constness.
-
- Huh? The word "const" means, fundamentally, "cannot be changed once
- initialized". This holds just as true for an externally defined const as
- any other. If you try the following in a module:
-
- extern const int iConst;
- iConst = 5;
-
- it won't compile. So what do you mean by, "it no longer is a const"?
-
-